//
//  JiRuDetailsView.m
//  明和智能
//
//  Created by 李李善 on 2018/8/24.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "JiRuDetailsView.h"
#import "UIView+Base.h"
@implementation JiRuDetailsView
- (instancetype)init
{
    self = [super init];
    if (self) {
        NSArray *ar = @[@"停车场:",
                        @"车牌号:",
                        @"停车时间:",
                        @"停车时才:",
                        @"收费标准:",
                        @"支付金额",
                        @"支付方式:",
                        @"交易编号:",
                        @"订单编号:"];
        NSMutableArray *arr = [NSMutableArray array];
        NSMutableArray *arr1 = [NSMutableArray array];
        for (NSString *ss in ar) {
            UILabel *label = ({
                UILabel *l  = [UILabel new];
                l.text = ss;
                l.font = kSysFont(kFitW(11));
                l.textColor = hexCOLOR(@"CCCCCC");
                [self addSubview:l];
                l;
            });
            [arr addObject:label];
            UILabel *label1 = ({
                UILabel *l  = [UILabel new];
                l.text = @"123";
                l.font = kSysFont(kFitW(11));
                l.textColor = [UIColor blackColor];
                [self addSubview:l];
                l;
            });
            [arr1 addObject:label1];
            
        }
        
        [self onMainSetSubViewFrame:^(UIView *view, CGPoint origin, CGSize size, CGPoint center) {
            CGFloat h = 0;
            int m = 0;
            for (UILabel *la in arr) {
                [la sizeToFit];
                la.left = kFitW(10);
                
                if (m==0) {
                la.top = h+m*kFitH(15)+kFitH(25);
                    h=kFitH(25);
                }else
                {
                la.top = h+m*kFitH(15);
                }
                UILabel *la1 = arr1[m];
                [la1 sizeToFit];
                la1.left = kFitW(90);
                la1.centerY = la.centerY;
                
                h = h+la.height;
                m++;
            }
        }];
        
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
